package models

import (
	"github.com/astaxie/beego"
	"github.com/astaxie/beego/orm"
	_ "github.com/go-sql-driver/mysql"
)

func init() {
	dataSource := beego.AppConfig.String("database::datasource")
	orm.RegisterDataBase("default", "mysql", dataSource)
	orm.RegisterModel(
		new(UserAdmin),
		new(UserAdminRole),
		new(Region),
		new(School),
		new(StudentRelation),
		new(Course),
		new(ArticleType),
		new(Article),
		new(Class),
		new(Student),
		new(User),
		new(MfcardUploadLog),
		new(MfbusUploadLog),
		new(Device),
		new(SafeNotice),
		new(WechatMenu),
		new(WechatReply),
		new(UserStudent),
		new(UserClass),
		new(AuthorityCategory),
		new(Authority),
		new(UserAdminRoleAuthority),
		new(SchoolBusNotice),
		new(WithdrawRecord),
		new(Finance),
		new(Feedback),
		new(VerifyCode),
		new(TempNotice),
		new(DevicePicture),
		new(Travel),
		new(TravelStudent),
		new(MiniProgramContract),
		new(PapPayApplyRecord),
		new(NewNotice),
		new(Homework),
		new(HomeworkNotice),
		new(Meeting),
		new(MeetingNotice),
		new(GradeNotice),
		new(WeekCourse),
		new(WeekCourseNotice),
		new(CardNumLib),
		new(DeductionRecord),
	)
	orm.RunSyncdb("default", false, true)
}
